<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let obj = {
        uname: '刘德华',
        age: '60',
        gender: '男',
        address: '香港',
      }
      //遍历对象
      for (let key in obj) {
        console.log(obj[key])
        //key是每一个属性  它输出的是字符串类型
        //单个输出的格式是:例如：console.log(obj['age'])
        // 所以console.log(obj[key])这里不需要加引号
      }
    </script>
  </body>
</html>
